package com.lsb.blog.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lsb.blog.pojo.Article;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lsb.blog.vo.Archives;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author liusibo
 * @since 2021-08-01
 */
@Repository
public interface ArticleMapper extends BaseMapper<Article> {
    //首页 文章归档
    List<Archives> listArchives();
    //文章阅读数量+1
    int updateViewCountByArticleId(Long id);
    //文章评论数量+1
    int updateCommentCountByArticleId(Long id);
    //mybatis动态sql 多条件分页查询 文章列表
    IPage<Article> listArticle(Page<Article> page, Long categoryId, Long tagId, String year, String month);
}
